<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />
  <title>demo</title>
  <!-- 引入Vue -->
  <script type="text/javascript" src="../../js/vue.js"></script>
</head>

<body>
  <!-- 准备好一个容器-->
  <div id="demo">
    <h2>前端圈的第{{n}}个框架是</h2>
    <button @click="n+=1">点我加一</button>
    <!-- v-if 代码的效率比较低 -->
    <!-- <h3 v-if="n===1">Angular</h3>
    <h3 v-if="n===2">React</h3>
    <h3 v-if="n===3">Vue</h3>
    <h3 v-if="n>4">未知</h3> -->
    <!-- v-else-if 代码运行效率较高 -->
    <h3 v-if="n===1">Angular</h3>
    <h3 v-else-if="n===2">React</h3>
    <h3 v-else-if="n===3">Vue</h3>
    <h3 v-else-if="n>4">未知</h3>
  </div>
</body>

<script type="text/javascript">
  let vm = new Vue({
    el: "#demo",
    data() {
      return {
        n: 1
      }
    }
  })
</script>

</html>